<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" layout:decorator="index">
<head>
<meta charset="UTF-8"/>
<script
	src="http://maps.google.cn/maps/api/js?region=cn&amp;language=zh-CN&amp;key=AIzaSyBstR892zJsiXLIPBeH6y7GsbIJYy30C7Y&amp;libraries=visualization&amp;language=zh-CN"></script>
<script>
var map;
var Location;

function creatMark(a,b)
{
	if(map==null){
		var mapProp = {
				  disableDoubleClickZoom:true,		
				  center:new google.maps.LatLng(a,b),
				  zoom:16,
				  mapTypeId:google.maps.MapTypeId.ROADMAP
				  };
				map=new google.maps.Map(document.getElementById("result1"),mapProp);
	}else{
		map.setCenter(new google.maps.LatLng(a,b));
		Location.setMap(null);
	}
	var origin = new google.maps.Marker({
	    position: new google.maps.LatLng(a,b),
	    icon: origin   //图标
	  });
	origin.setMap(map);
	Location=origin;

	 $('#myModal1').modal('show');
	 $("#result1").addClass("resultclass");


}



</script>

<style type="text/css">
	.resultclass{
		width: 800px;
		height:440px;
	}
</style>

</head>
<body>
<div layout:fragment="content" class="content">
		<ol class="breadcrumb" th:object="${funplace}">
			<li th:text="*{funplace1}"><a href="#">系统管理</a></li>
			<li th:text="*{funplace2}"><a href="#">用户管理</a></li>
			<li th:text="*{funplace3}" class="active">用户添加</li>
		</ol>
		<form action="/device/getalarm" method="post">
			<div class="selectForm">
				<button type="submit" class="btn btn-success ">条件搜索</button>
				&nbsp;&nbsp;
				<button type="button" class="btn btn-danger" style="width: 82px;" oclick="clearSelect()">清空</button>&nbsp;&nbsp;
				<input type="text" class="clear1" th:value="${deviceID}"  name="deviceID" id="firstname" placeholder="请输入设备id"    />
				<input type="date" class="clear2" th:value="${startTime}" name="startTime" id="firstname" placeholder="请输入开始时间" />
				<input type="date" class="clear2" th:value="${endTime}" name="endTime" id="firstname" placeholder="请输入结束时间"   />&nbsp;&nbsp;
			   	共<span th:text="${List.size()}"></span>条记录
			</div>




		</form>

      <table class="table">

      <thead>
        <tr >
          
          <th  >设备ID</th>
          <th  >上报时间</th>
          <th  >创建时间</th>
          <th  >告警名称</th>
          <th  >围栏名称</th>

          <span >
          <th  >操作</th>
          </span>
        </tr>
      </thead>
      <tbody>

        <tr class="success" th:each="List : ${List}">
          <td th:text="${List.deviceId}">小虎</td>
         <td th:text="${#dates.format(List.alarmDatetime,'yyyy-MM-dd HH:mm:ss')}">小虎</td>
         <td th:text="${#dates.format(List.createTime,'yyyy-MM-dd HH:mm:ss')}">小虎</td>
         <td th:text="${List.name}">小虎</td>
         <td th:text="${List.fenceName}">小虎</td>
     
        
          <td>
          <button class="btn btn-primary btn-lg"  th:onclick="'javascript:mqttData('+${List.id}+',4)' ">日志</button>
          <span th:if="${List.latitude!=null}">
          <button class="btn btn-primary btn-lg"  th:onclick="'javascript:creatMark('+${List.latitude}+','+${List.longitude}+')'">定位</button>
          </span>
             <!--   <a   th:href="@{/user/deleteUser(id=${List.deviceId})}"> 删除</a>-->
             <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			    <div class="modal-dialog">
			        <div class="modal-content">
			            <div class="modal-header">
			                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			                <h4 class="modal-title" id="myModalLabel">当前数据日志</h4>
			            </div>
			            <div class="modal-body" ><pre id="result" ></pre></div>
			            <div class="modal-footer">
			                <button type="button" class="btn btn-default" data-dismiss="modal" >关闭</button>			             
			            </div>
			        </div><!-- /.modal-content -->
			    </div><!-- /.modal -->
			</div>
             <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			    <div class="modal-dialog">
			        <div class="modal-content"  style="width: 830px;height: 600px">
			            <div class="modal-header">
			                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			                <h4 class="modal-title" id="myModalLabel">当前数据日志</h4>
			            </div>
			            <div class="modal-body" ><pre id="result1" ></pre></div>
			            <div class="modal-footer">
			                <button type="button" class="btn btn-default" data-dismiss="modal" >关闭</button>			             
			            </div>
			        </div><!-- /.modal-content -->
			    </div><!-- /.modal -->
			</div>
          </td>
 		
        </tr>


      </tbody>



    </table>



</div>



</body>

</html>
